﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:odc="clr-namespace:Odyssey.Controls">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Odyssey;Component/Themes/BreadcrumbBar/AeroChrome.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Odyssey;Component/Themes/BreadcrumbBar/BreadcrumbButton.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Odyssey;Component/Themes/BreadcrumbBar/BreadcrumbItem.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Odyssey;Component/Themes/BreadcrumbBar/ProgressBar.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Odyssey;Component/Themes/BreadcrumbBar/ButtonTemplates.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <SolidColorBrush x:Key="focusedBackground" Color="White" />
    <Color x:Key="focusedBackgroundColor">White</Color>
    <odc:EmptyStringVisibilityConverter x:Key="emptyStringVisibilityConverter" />

    <Style TargetType="{x:Type odc:OdcTextBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type odc:OdcTextBox}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Focusable="False"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Border BorderBrush="White" BorderThickness="1" Focusable="False">
                            <Grid Focusable="False">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="textBox" Grid.Column="0" Focusable="{TemplateBinding Focusable}"
                                        Text="{Binding Text,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                                        BorderThickness="0" Background="Transparent" />
                                <TextBlock x:Name="infoText" Text="{TemplateBinding Info}" Visibility="Collapsed" VerticalAlignment="Center" Grid.Column="0" IsHitTestVisible="False"
                                        HorizontalAlignment="Left" Margin="4,0,0,2" Foreground="Gray" FontStyle="Italic" />
                                <ItemsControl x:Name="buttons" Grid.Column="1" Margin="1,0,-1,0"
                                        ItemsSource="{Binding Buttons,RelativeSource={RelativeSource TemplatedParent} }" Focusable="False">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" IsItemsHost="True" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>
                            </Grid>
                        </Border>
                    </Border>

                    <ControlTemplate.Resources>
                        <Style TargetType="{x:Type Button}">
                            <Setter Property="Template" Value="{StaticResource ButtonTemplate}" />
                            <Setter Property="MinWidth" Value="21" />
                            <Setter Property="BorderThickness" Value="0" />
                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                            <Setter Property="Focusable" Value="False" />
                            <Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey odc:Skins, BorderBrush}}" />

                        </Style>
                    </ControlTemplate.Resources>


                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Text" Value="" SourceName="textBox" />
                                <Condition Property="IsFocused" Value="False" SourceName="textBox" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="infoText" Value="Visible" />
                        </MultiTrigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.10" To="{StaticResource focusedBackgroundColor}"
                                                Storyboard.TargetProperty="Background.Color" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.20" From="{StaticResource focusedBackgroundColor}"
                                                Storyboard.TargetProperty="Background.Color" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger SourceName="textBox" Property="IsFocused" Value="True">
                            <Setter Property="Background" Value="{StaticResource focusedBackground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="#A0FFFFFF" />
        <Setter Property="BorderBrush" Value="{StaticResource borderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey odc:Skins, BorderBrush}}" />
    </Style>
</ResourceDictionary>